﻿using System;
using System.Globalization;
using System.Windows.Data;
using YFurion.Localization;

namespace UpperComputer.WPF.Entry.Converters
{
    public class BooleanToYesOrNoStringBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ArgumentNullException.ThrowIfNull(value, "value");
            ILocalizationManager lang = Furion.App.GetService<ILocalizationManager>();
            string yesOrNo = (bool)value ? lang["是"] : lang["否"];
            return yesOrNo;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
